Constipation algorithm